#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtCore/qhash.h>
#include <QtGui/qmainwindow.h>

QT_FORWARD_DECLARE_CLASS(QMdiArea)
QT_FORWARD_DECLARE_CLASS(QMdiSubWindow)
QT_FORWARD_DECLARE_CLASS(QTabBar)

//class ComponentWindow;
class LibraryModel;
class LibraryDock;
class QedaComponent;

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

public slots:

protected:
    void closeEvent(QCloseEvent *event);

private slots:
    void fileOpen();
    void fileSave();
    void helpAbout();
    void viewLanguage();
    void componentEdit(QedaComponent *component);
    void changeTabColor(bool redFlag);

private:
    void createActions();
    void createDocks();
    void createMenus();
    QMdiSubWindow *findComponentWin(QedaComponent *component);


private:
    const static char               *m_languages[];
    QHash<const QString, QAction *>  m_actions;

    QMdiArea                        *m_mdiArea;
    QTabBar                         *m_tabBar;
    LibraryDock                     *m_libDock;

    LibraryModel                    *m_libModel;
};

#endif // MAINWINDOW_H
